package edu.cs.usask.ca.silver.persistence.sql;

/**
 * @author Daniel Funk Collection of SQL Strings for operations related to
 *         ParameterSets.
 */
public interface PgSQLParameterSetStringsI {
	public static final String PARAMETERSET_INSERT = "INSERT INTO ParameterSet (ps_description) VALUES ('%s')";

	public static final String PARAMETERSET_SELECTALLPARAMETERS = "SELECT p_id, p_name, p_type, p_units, p_class, p_description, p2ps_value "
			+ "FROM P2Ps, Parameter WHERE (p2ps_p_id = %d) AND (p2ps_ps_id = %d) AND (p_id = %d)";

	public static final String PARAMETERSET_SELECT_DESCRIPTION = "SELECT ps_description FROM ParameterSet WHERE ps_ID = %d";

	public static final String PARAMETERSET_SET_DESCRIPTION = "UPDATE ParameterSet SET ps_description = '%s' WHERE ps_ID = %d";

	public static final String PARAMETERSET_DELETE = "DELETE FROM ParameterSet WHERE ps_id = %d";

	// Going from ParameterSet to Parameters
	public static final String PARAMETERSET_SELECT_PARAMETERIDS = "SELECT p2ps_p_id FROM P2Ps WHERE p2ps_ps_ID = %d";

	/*
	 * EDITED BY MIKE: The following two line had references to columns that did
	 * not exist 1st: p2s_ps_value 2nd: p2s_ps_comment. These column names do
	 * not exist in the table as perviously mentioned but instead are p2ps_value
	 * and p2ps_comment respectively
	 */
	public static final String PARAMETERSET_SELECT_VALUE = "SELECT p2ps_value FROM P2Ps WHERE p2ps_p_id = %d AND p2ps_ps_id = %d";
	public static final String PARAMETERSET_SELECT_COMMENT = "SELECT p2ps_comment FROM P2Ps WHERE p2ps_p_id = %d AND p2ps_ps_id = %d";

	/* EDITED BY Alan Yeung: p2ps_comment from p2ps_ps_comment */
	public static final String PARAMETERSET_SET_COMMENT = "UPDATE P2Ps SET p2ps_comment = '%s' WHERE p2ps_p_id = %d AND p2ps_ps_id = %d";

	public static final String PARAMETERSET_COPY = "INSERT INTO ParameterSet (ps_description) VALUES((SELECT ps_description FROM ParameterSet WHERE ps_ID = %d))";

}
